﻿﻿<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-05 15:50:07
 * @LastEditTime: 2019-09-18 10:28:51
 * @LastEditors: Please set LastEditors
 -->
{namespace n=GeorgRinger\News\ViewHelpers}
{namespace ngoos=Ngoos\SiteConfig\ViewHelpers}
<style type="text/css">
    .c-desc p {
        margin: 15px;
        line-height: 1.8em;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: 4;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    @media(max-width: 768px) {
        .c-desc p {
            -webkit-line-clamp: 3;
        }

        .c-date,
        .c-comments {
            margin: 6px 10px 6px 0;
        }

        .article .c-theme-ul-bg a {
            line-height: unset;
            padding-top: 1px;
            padding-bottom: 2px;
        }
    }
</style>
<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
    <div class=" itemlist">
    <div class="c-content-blog-post-1">
        <div class="c-title c-font-bold c-font-uppercase">
            <!--标题-->
            <f:if condition="{settings.showType}">
            	<f:then>
		            <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem,newsid:newsItem.uid}">
		                <f:if condition="{newsItem.istopnews}">
		                    [置顶]
		                </f:if>
		                {newsItem.title}
		            </f:link.action>
            	</f:then>
            	<f:else>
		            <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem}">
		                <f:if condition="{newsItem.istopnews}">
		                    [置顶]
		                </f:if>
		                {newsItem.title}
		            </f:link.action>
            	</f:else>
            </f:if>
        </div>
        <div class="row">
            <!--图片-->
            <f:if condition="{newsItem.imgpath}">
                <f:then>
                    <div class="col-md-3">
                    	<f:if condition="{settings.showType}">
                    		<f:then>
		                        <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem,newsid:newsItem.uid}">
				                       <f:image src="/uploads/tx_news/titles/{newsItem.imgpath}" title="{newsItem.title}"
		                            alt="{newsItem.title}" width="188c" height="104c" />
		                        </f:link.action>
                    		</f:then>
                    		<f:else>
		                        <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem}">
				                       <f:image src="/uploads/tx_news/titles/{newsItem.imgpath}" title="{newsItem.title}"
		                            alt="{newsItem.title}" width="188c" height="104c" />
		                        </f:link.action>
                    		</f:else>
                    	</f:if>
                    </div>
                </f:then>
                <f:else>
                    <f:if condition="{ngoos:getImgUrlFromContent(content:newsItem.bodytext)}">
                        <div class="col-md-3">
                    		<f:if condition="{settings.showType}">
                    			<f:then>
		                        	<f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem,newsid:newsItem.uid}">
					                       <f:image src=" {ngoos:getImgUrlFromContent(content:newsItem.bodytext,nuid:newsItem.uid)}"
		                                title="{newsItem.title}" alt="{newsItem.title}" />
		                            </f:link.action>
                    			</f:then>
                    			<f:else>
		                        	<f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem}">
					                       <f:image src=" {ngoos:getImgUrlFromContent(content:newsItem.bodytext,nuid:newsItem.uid)}"
		                                title="{newsItem.title}" alt="{newsItem.title}" />
		                            </f:link.action>
                    			</f:else>
                    		</f:if>
                        </div>
                    </f:if>
                </f:else>
            </f:if>

            <div class="c-desc">
                <p>
                    <f:if condition="{newsItem.teaser}">
                        <f:then>{newsItem.teaser -> f:format.stripTags()}</f:then>
                        <f:else>{newsItem.bodytext -> f:format.stripTags()}</f:else>
                    </f:if>
                </p>
            </div>
        </div>
        <div class="c-panel">
            <div class="c-date">
                <span class="c-font-uppercase">{newsItem.author} | <f:format.date
                        format="{f:translate(key:'dateFormat')}">{newsItem.datetime}</f:format.date></span>
            </div>
            <ul class="c-tags c-theme-ul-bg">
                <li>
                	<f:if condition="{settings.showType}">
                		<f:then>
		                    <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem,newsid:newsItem.uid}" style=" color:white;">
		 						详情
		                    </f:link.action>
                		</f:then>
                		<f:else>
		                    <f:link.action pageUid="{settings.detailPid}" extensionName="news" pluginName="pi1" controller="News" action="detail" arguments="{news : newsItem}" style=" color:white;">
		 						详情
		                    </f:link.action>
                		</f:else>
                	</f:if>
                </li>
            </ul>
            <div class="c-comments">
                <i class="icon-speech"></i> {newsItem.hit} 点击量
            </div>
        </div>
    </div>
</div>
</div>